package com.oceansoft.mobile.econsole.modules.weixin.persistence;

import com.oceansoft.mobile.econsole.modules.base.entity.Query;
import com.oceansoft.mobile.econsole.modules.weixin.entity.WxMember;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * 
 * @author jin.xu
 * @createTime 2015年4月10日 上午10:13:10
 * @packagePath com.oceansoft.mobile.econsole.modules.weixin.persistence.IWxMemberMapper.java
 */
@Repository
public interface IWxMemberMapper {
    int deleteByPrimaryKey(Short id);

    int insert(WxMember record);

    int insertSelective(WxMember record);

    WxMember selectByPrimaryKey(Integer id);
    
    List<WxMember> selectByOpenId(String openId);

    int updateByPrimaryKeySelective(WxMember record);

    int updateByPrimaryKey(WxMember record);
    
    int updateByOpenId(WxMember record);
    /**
     * 通过openid查用户
     */
    WxMember findMemberByOpenId(@Param("openId") String openId);
    List<WxMember> findByCondition(Query query);
    
    /**
     * 取消绑定
     * @param openid
     */
    int delWxMemberById(String openid);
    
    /**
     * 根据openid删除记录
     * @param openId
     * @return
     */
    int delWxMemberByOpenId(String openId);
    
    /**
     * 根据openid删除驾车信息
     * @param openId
     * @return
     */
    int delWxDriverInfo(String openId);
}